<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Healthy Life System</title>
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
        <link href="../hesk_style.css" type="text/css" rel="stylesheet" />
        <script language="Javascript" type="text/javascript" src="../hesk_javascript.js"></script>
        <script language="Javascript" type="text/javascript" src="../jquery-1.6.1.min.js"></script>

        <script type="text/javascript" src="../_lib/jquery.js"></script>
        <script type="text/javascript" src="../jquery.jstree.js"></script>
        <script type="text/javascript" src="../_lib/crypto.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $("#tabs").tabs();
            });
            
            function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){        
                FB.ui({ method : 'feed', 
                    method: 'feed',
                    name: 'Facebook Dialogs',
                    link: 'http://developers.facebook.com/docs/reference/dialogs/',
                    picture: 'http://fbrell.com/f8.jpg',
                    caption: 'Reference Documentation',
                    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
                    message: 'Facebook Dialogs are easy!'
                });
                //http://developers.facebook.com/docs/reference/dialogs/feed/
            }
            
            function publishStream(){
                streamPublish("Stream Publish", '', 'Coba Healthy Life System', 'http://dokter-online.bamboomedia.net', "Demo Facebook Application Tutorial");
            }
            
            function inviteFriends(){
                var receiverUserIds = FB.ui({ 
                    method : 'apprequests',
                    message: 'Ayo coba aplikasi Healthy Life System. Aplikasi ini dapat mendiagnosa penyakit kamu secara online. Kunjungi http://dokter-online.bamboomedia.net'
                },
                function(receiverUserIds) {
                    console.log("IDS : " + receiverUserIds.request_ids);
                }
            );
                //http://developers.facebook.com/docs/reference/dialogs/requests/
            }
        </script>
    </head>
    <body>
        <div id="fb-root"></div>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
        <script type="text/javascript">
            FB.init({
                appId  : '<?= $fbconfig['appid'] ?>',
                status : true, // check login status
                cookie : true, // enable cookies to allow the server to access the session
                xfbml  : true  // parse XFBML
            });
        </script>

        <a href="<?= $fbconfig['appBaseUrl'] ?>" target="_top">Home</a> |
        <a href="#" onclick="inviteFriends(); return false;">Send Request/Send Invitation</a>

        <br /><br />
        <?php
        if (isset($page)) {
            if ($page === 'home.php')
                include_once $page;
        }
        ?>
    </body>
</html>